Tables [dbo].[GiftAidDeclaration]
Properties
PropertyValue
Created10:31:23 AM Tuesday, March 02, 2010
Last Modified1:20:15 PM Thursday, February 23, 2012
Columns
NameData TypeMax Length (Bytes)Allow NullsDefault
Foreign Keys FK_GiftAidDeclaration_Name: [dbo].[Name].IDIndexes IX_GiftAidDeclaration_ID: IDIDvarchar(10)10
No
Cluster Primary Key PK_GiftAidDeclaration: GiftAidDeclarationKeyGiftAidDeclarationKeyuniqueidentifier16
No
DeclarationReceivedDatedatetime8
Yes
DeclarationMethodKeynvarchar(10)20
No
('')
IsConfirmationRequiredbit1
No
((0))
IsUsing6YearRulebit1
No
((0))
DeclarationStartDatedatetime8
Yes
DeclarationEndDatedatetime8
Yes
DeclarationNotesnvarchar(4000)8000
Yes
TaxpayerFirstNamevarchar(40)40
No
('')
TaxpayerLastNamevarchar(40)40
No
('')
TaxpayerPrefixvarchar(20)20
No
('')
TaxpayerAddress1nvarchar(40)80
No
('')
TaxpayerAddress2nvarchar(40)80
No
('')
TaxpayerAddress3nvarchar(40)80
No
('')
TaxpayerCitynvarchar(40)80
No
('')
TaxpayerCountynvarchar(15)30
No
('')
TaxpayerPostcodenvarchar(10)20
No
('')
TaxpayerCountrynvarchar(25)50
No
('')
IsHighRateTaxpayerbit1
No
((0))
IsTaxRecoveredUnrestrictedbit1
No
((0))
Statusnvarchar(10)20
No
StatusUpdatedDatedatetime8
Yes
AppealCodevarchar(40)40
Yes
('')
ConfirmationSentDatedatetime8
Yes
Foreign Keys FK_GiftAidDeclaration_ContactMain_CreatedBy: [dbo].[UserMain].CreatedByUserKeyIndexes IX_GiftAidDeclaration_CreatedByUserKey: CreatedByUserKeyCreatedByUserKeyuniqueidentifier16
No
CreatedOndatetime8
No
Foreign Keys FK_GiftAidDeclaration_ContactMain_UpdatedBy: [dbo].[UserMain].UpdatedByUserKeyIndexes IX_GiftAidDeclaration_UpdatedByUserKey: UpdatedByUserKeyUpdatedByUserKeyuniqueidentifier16
No
UpdatedOndatetime8
No
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_GiftAidDeclaration: GiftAidDeclarationKeyPK_GiftAidDeclarationGiftAidDeclarationKey
Yes
IX_GiftAidDeclaration_CreatedByUserKeyCreatedByUserKey
IX_GiftAidDeclaration_IDID
IX_GiftAidDeclaration_UpdatedByUserKeyUpdatedByUserKey
Foreign Keys Foreign Keys
NameColumns
FK_GiftAidDeclaration_ContactMain_CreatedByCreatedByUserKey->[dbo].[UserMain].[UserKey]
FK_GiftAidDeclaration_ContactMain_UpdatedByUpdatedByUserKey->[dbo].[UserMain].[UserKey]
FK_GiftAidDeclaration_NameID->[dbo].[Name].[ID]
Permissions
TypeActionOwning Principal
GrantDeleteIMIS
GrantInsertIMIS
GrantReferencesIMIS
GrantSelectIMIS
GrantUpdateIMIS
SQL Script
CREATE TABLE [dbo].[GiftAidDeclaration]
(
[ID] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[GiftAidDeclarationKey] [uniqueidentifier] NOT NULL,
[DeclarationReceivedDate] [datetime] NULL,
[DeclarationMethodKey] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_DeclarationMethodKey] DEFAULT (''),
[IsConfirmationRequired] [bit] NOT NULL CONSTRAINT [DF_GiftAidDeclaration_IsConfirmationRequired] DEFAULT ((0)),
[IsUsing6YearRule] [bit] NOT NULL CONSTRAINT [DF_GiftAidDeclaration_IsUsing6YearRule] DEFAULT ((0)),
[DeclarationStartDate] [datetime] NULL,
[DeclarationEndDate] [datetime] NULL,
[DeclarationNotes] [nvarchar] (4000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[TaxpayerFirstName] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerFirstName] DEFAULT (''),
[TaxpayerLastName] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerLastName] DEFAULT (''),
[TaxpayerPrefix] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerPrefix] DEFAULT (''),
[TaxpayerAddress1] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerAddress1] DEFAULT (''),
[TaxpayerAddress2] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerAddress2] DEFAULT (''),
[TaxpayerAddress3] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerAddress3] DEFAULT (''),
[TaxpayerCity] [nvarchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerCity] DEFAULT (''),
[TaxpayerCounty] [nvarchar] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerCounty] DEFAULT (''),
[TaxpayerPostcode] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerPostCode] DEFAULT (''),
[TaxpayerCountry] [nvarchar] (25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [DF_GiftAidDeclaration_TaxPayerCountry] DEFAULT (''),
[IsHighRateTaxpayer] [bit] NOT NULL CONSTRAINT [DF_GiftAidDeclaration_IsHighRateTaxPayer] DEFAULT ((0)),
[IsTaxRecoveredUnrestricted] [bit] NOT NULL CONSTRAINT [DF_GiftAidDeclaration_IsTaxRecoveredUnrestricted] DEFAULT ((0)),
[Status] [nvarchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[StatusUpdatedDate] [datetime] NULL,
[AppealCode] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL CONSTRAINT [DF_GiftAidDeclaration_AppealCode] DEFAULT (''),
[ConfirmationSentDate] [datetime] NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL
) ON [PRIMARY]

GO
ALTER TABLE [dbo].[GiftAidDeclaration] ADD CONSTRAINT [PK_GiftAidDeclaration] PRIMARY KEY CLUSTERED ([GiftAidDeclarationKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_GiftAidDeclaration_CreatedByUserKey] ON [dbo].[GiftAidDeclaration] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_GiftAidDeclaration_ID] ON [dbo].[GiftAidDeclaration] ([ID]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_GiftAidDeclaration_UpdatedByUserKey] ON [dbo].[GiftAidDeclaration] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[GiftAidDeclaration] ADD CONSTRAINT [FK_GiftAidDeclaration_ContactMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[GiftAidDeclaration] ADD CONSTRAINT [FK_GiftAidDeclaration_ContactMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[GiftAidDeclaration] ADD CONSTRAINT [FK_GiftAidDeclaration_Name] FOREIGN KEY ([ID]) REFERENCES [dbo].[Name] ([ID])
GO
GRANT REFERENCES ON  [dbo].[GiftAidDeclaration] TO [IMIS]
GRANT SELECT ON  [dbo].[GiftAidDeclaration] TO [IMIS]
GRANT INSERT ON  [dbo].[GiftAidDeclaration] TO [IMIS]
GRANT DELETE ON  [dbo].[GiftAidDeclaration] TO [IMIS]
GRANT UPDATE ON  [dbo].[GiftAidDeclaration] TO [IMIS]
GO
Uses